package com.luck.org.entity;

import java.io.Serializable;

import com.luck.pf.util.FormateUtil;


/**
 * @hibernate.class table="V_USER"
 * 说明:人员表
 * Copyright: Copyright (c) 2010
 * @author zhangwenrui 2010-8-4 下午02:52:41
 * @version 1.0
 */
public class VUser  implements Serializable {
	private static final long serialVersionUID = 57626928745523430L;
	private Long id;
	private Long deptId;
	private VDepartment dept;
    private String loginname; // 登录名
    private String realname;//真实名字
    private int enabled; // 是否可用
    private String userLevel;//用户级别,1:管理员,2:操作员
    private String systemFlag;//系统标志,默认全部, ROOT_ORG:后台管理，ROOT_BS:前台系统

	/**
     * @hibernate.id generator-class = "assigned" length = "16"
     * @return
     */
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	/**
     * @hibernate.property length="16" column="dept_id"
     */
	public Long getDeptId() {
		return deptId;
	}

	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}

    /**
     * @hibernate.many-to-one class = "com.luck.org.entity.VDepartment" column="dept_id" insert="false" update="false" lazy="false"
     * @return
     */
	public VDepartment getDept() {
		return dept;
	}

	public void setDept(VDepartment dept) {
		this.dept = dept;
	}

	/**
     * @hibernate.property length="30" column="loginname"
     */
	public String getLoginname() {
		return loginname;
	}

	public void setLoginname(String loginname) {
		this.loginname = loginname;
	}

	/**
     * @hibernate.property length="20" column="realname"
     */
	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}


	/**
     * @hibernate.property length="2" column="is_enabled"
     */
	public int getEnabled() {
		return enabled;
	}

	public void setEnabled(int enabled) {
		this.enabled = enabled;
	}

	/**
     * @hibernate.property length="2" column="user_level"
     */
	public String getUserLevel() {
		return userLevel;
	}

	public void setUserLevel(String userLevel) {
		this.userLevel = userLevel;
	}

	/**
     * @hibernate.property length="10" column="system_flag"
     */
	public String getSystemFlag() {
		return systemFlag;
	}

	public void setSystemFlag(String systemFlag) {
		this.systemFlag = systemFlag;
	}
	public String getEnabledStr() {
		if(this.enabled==1)
			return "启用";
		else
			return "停用";
	}

	public String getSystemFlagStr() {
		return FormateUtil.getInstance().getNameByCode("p_system_flag", this.systemFlag);
	}
	public String getUserLevelStr() {
		String str = "";
		if(this.userLevel.equals("1"))
			str="管理员";
		if(this.userLevel.equals("2"))
			str="操作员";
		return str;
	}

}
